home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / getcontext.z / getcontext
Encoding:
Text File  |  2002-10-03  |  5.3 KB  |  66 lines

  1.  
  2.  
  3.  
  4. ggggeeeettttccccoooonnnntttteeeexxxxtttt((((2222))))                                                    ggggeeeettttccccoooonnnntttteeeexxxxtttt((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _gggg_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt, _ssss_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt - get and set current user context
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_uuuu_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt_...._hhhh_>>>>
  13.      _iiii_nnnn_tttt _gggg_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt_((((_uuuu_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt______tttt _****_uuuu_cccc_pppp_))))_;;;;
  14.      _iiii_nnnn_tttt _ssss_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt_((((_uuuu_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt______tttt _****_uuuu_cccc_pppp_))))_;;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      These functions, along with those defined in _mmmm_aaaa_kkkk_eeee_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt(3C), are useful
  18.      for implementing user level context switching between multiple threads of
  19.      control within a process.
  20.  
  21.      _gggg_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt initializes the structure pointed to by _u_c_p to the current
  22.      user context of the calling process.  The user context is defined by
  23.      _uuuu_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt(5) and includes the contents of the calling process's machine
  24.      registers, signal mask and execution stack.
  25.  
  26.      _ssss_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt restores the user context pointed to by _u_c_p.  The call to
  27.      _ssss_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt does not return;  program execution resumes at the point
  28.      specified by the context structure passed to _ssss_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt.  The context
  29.      structure should have been one created either by a prior call to
  30.      _gggg_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt or _mmmm_aaaa_kkkk_eeee_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt or passed as the third argument to a signal
  31.      handler [see _ssss_iiii_gggg_aaaa_cccc_tttt_iiii_oooo_nnnn(2)].  If the context structure was one created
  32.      with _gggg_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt, program execution continues as if the corresponding call
  33.      of _gggg_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt had just returned.  If the context structure was one
  34.      created with _mmmm_aaaa_kkkk_eeee_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt, program execution continues with the function
  35.      specified to _mmmm_aaaa_kkkk_eeee_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt.
  36.  
  37. NNNNOOOOTTTTEEEESSSS
  38.      When a signal handler is executed, the current user context is saved and
  39.      a new context is created by the kernel.  If the process leaves the signal
  40.      handler via _llll_oooo_nnnn_gggg_jjjj_mmmm_pppp(3C) the original context will not be restored, and
  41.      future calls to _gggg_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt will not be reliable.  Signal handlers should
  42.      use _ssss_iiii_gggg_llll_oooo_nnnn_gggg_jjjj_mmmm_pppp(3C) or _ssss_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt instead.
  43.  
  44. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  45.      On successful completion, _ssss_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt does not return and _gggg_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt
  46.      returns 0.  Otherwise, a value of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to
  47.      indicate the error.
  48.  
  49. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  50.      _ssss_iiii_gggg_aaaa_cccc_tttt_iiii_oooo_nnnn(2), _ssss_iiii_gggg_aaaa_llll_tttt_ssss_tttt_aaaa_cccc_kkkk(2), _ssss_iiii_gggg_pppp_rrrr_oooo_cccc_mmmm_aaaa_ssss_kkkk(2), _mmmm_aaaa_kkkk_eeee_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt(3C),
  51.      _uuuu_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt(5).
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.                                                                         PPPPaaaaggggeeee 1111
  63.  
  64.  
  65.  
  66.